class Todo(object):
    current_id = 0
    def get_id(self):
        Todo.current_id += 1
        new_id = Todo.current_id
        return new_id
    def __init__(self,  title:str, id:int=0, completed = False):
        self.id = id if id > 0 else self.get_id()
        self.title = title
        self.completed = completed
#to = Todo("学习python")
#print(to)
#to1 = Todo(title="学习web")
# print(to1.__dict__)
# dict = {"id": 3, "title": "学习自动化测试", "completed": False}
# to3 = Todo(**dict)
# print(to3)